{
  "properties" : { },
  "id" : "78a19c62c32b4eafa3f6ccb6a5f9ab8a",
  "script" : null,
  "groupId" : "8a4d09d5d4824ed99d9cf45868c29fe1",
  "name" : "添加",
  "createTime" : null,
  "updateTime" : 1736397984819,
  "lock" : null,
  "createBy" : "管理员",
  "updateBy" : "可辉",
  "path" : "add",
  "method" : "POST",
  "parameters" : [ ],
  "options" : [ {
    "name" : "permission",
    "value" : "system:jggl",
    "description" : "允许拥有该权限的访问",
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  } ],
  "requestBody" : "{\"unit_name\":\"新增单位\",\"unit_code\":\"\",\"unit_logo\":\"/img/logo-wiwf.png\",\"unit_db_code\":\"business\",\"sort\":99,\"status\":1,\"parent_id\":0}",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : null,
  "description" : null,
  "requestBodyDefinition" : null,
  "responseBodyDefinition" : null
}
================================
import com.gitee.fastmybatis.core.query.Query;

import 'com.wiwf.model.mapper.admin.dao.SysUnitMapper' as sysUnitMapper;

    if(body.unitId != null){
        return sysUnitMapper.update(body);
    }

return sysUnitMapper.save(body);
